home *** CD-ROM | disk | FTP | other *** search
- : getline ( -- addr len )
- linefeed word ( addr )
- count
- ;
- \ Copy 1 line from the input stream to the output file, returning true if the
- \ line starts with ` or the end of the file is reached.
- : 1line ( -- end? )
- getline ( addr end? )
- dup ( addr len len )
- if \ The line has some characters in it
- dup 2 <= >r over c@ ascii ` = r> and ( addr len f)
- if \ The line only contains a `
- 2drop true
- else
- ofd @ fputs linefeed ofd @ fputc
- false
- then
- else \ the line is empty ( addr len )
- 2drop delimiter @ -1 =
- then
- ;
- : extract \ filename ( -- )
- writing
- begin 1line until
- ofd @ close
- ;
-